Repository navigation
Share SQL stages and dispatch validated numerical kernels - #302
cromwellian wants to merge 3 commits into
Conversation
Support prepared SQL gradients, arithmetic chunk-grid counts and direct Arrow registration. Preserve Context metadata through extension installation, expose target partitions and guard physical reuse against value-dependent filters. Co-Authored-By: GPT-6 <noreply@openai.com>
Materialize shared reachable CTEs once, reuse stage programs with fresh physical state, and retain ddx differentiation of original views. Add optional session-local float64 CPU and float32 MLX kernel execution with SQL validation and fallback, using the separately maintained EinFold feature build. Co-Authored-By: GPT-6 <noreply@openai.com>
Build the upstream-compatible feature commit from the contribution fork. Co-Authored-By: GPT-6 <noreply@openai.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
🌀 Claude: Thank you. The measurements here are excellent: 1.53× on the tiny model from computing each CTE once, with every result checked. They show clearly what recomputing CTEs costs us. This PR's concerns are about where the code lives rather than whether it works. I've opened #307 to decide where each piece should go. Strengths
Concerns
I'd hold this PR until #307 settles. The pieces that stay in xarray-sql (the host tolerances, and the demos on public APIs) could then land on their own. |
🛠️ Codex
Evaluate reachable shared CTEs once per invocation and reuse their stage programs while keeping ddx differentiation of the original SQL/views. Add session-local EinFold numerical dispatch for explicit float64 CPU or float32 MLX GPU execution, deterministic function eligibility, fresh physical state, ordered Arrow providers and bounded coordinate reuse. Ordinary SQL remains the fallback for unsupported semantics.
Depends on CPU setup/preparation #301 and EinFold’s kernel-backend PR. Incremental review: cromwellian/xarray-sql@codex/training-plan-reuse...codex/shared-kernel-execution . GitHub requires fork PRs to target upstream main, so the default diff includes the predecessor until it merges.
Measured tiny-model shared CPU/GPU warm steps improved 314→206 ms (1.53×) and 371→224 ms (1.66×), with fewer repeated kernel dispatches. GPU alone did not solve large-model backward/Arrow overhead. The separate compact-array and resident-training PRs address those remaining costs. The performance/evidence PR retains the detailed workloads and raw results.
The optional installer builds a pinned commit from the separate EinFold fork; native sources and patches are not duplicated here. Validation of the full contribution stack: 714 non-integration tests passed against rebuilt dependency wheels, including SQL masks/NULLs, custom-function overrides, changing inputs, coordinates and snapshots. Rust formatting and changed-file Ruff checks passed. GPU arithmetic remains explicit float32.